<!DOCTYPE html>
<html lang="en"xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>用户信息</title>
    <script src="jqury/jquery-3.3.1.min.js"></script>
    <script src="bootstrap/bootstrap.min.js"></script>
    <link rel="stylesheet" href="bootstrap/bootstrap-theme.min.css">
    <link rel="stylesheet" href="bootstrap/bootstrap.min.css">
</head>
<body>
<!--    用户id：<h3 th:text="${user.id}"></h3>-->
    <form class="form-inline" action="/modify" method="post">
        <input type="hidden" name="id" th:value="${user.id}">
        <div class="form-group">
            <label for="exampleInputName2">用户名称</label>
            <input type="text" class="form-control" name="username" id="exampleInputName2" th:placeholder="${user.username}">
        </div>
        <div class="form-group">
            <label for="exampleInputEmail2">用户密码</label>
            <input type="text" class="form-control" name="password" id="exampleInputEmail2" th:placeholder="${user.password}">
        </div>
        <div class="form-group">
            <label for="exampleInputEmail3">用户权限</label>
            <input type="text" class="form-control" name="role" id="exampleInputEmail3" th:placeholder="${user.role}">
        </div>
        <button type="submit" class="btn btn-default">修改</button>

        <div class="form-group">
            <table>
                <tr>
                    <th>证书</th>
                    <th>操作</th>
                </tr>
                <tr th:each="userImg:${userImgBeans}">
                    <td>
                        <img th:src="${userImg.img}"/>
                    </td>
                    <td>

                        <input type="button" id="btnDel" value="删除图片" th:onclick="'javascript:delUserImg('+${userImg.id}+','+${user.id}+')'">

                    </td>
                </tr>
            </table>
        </div>
    </form>

<script>
    function delUserImg(id,userid) {
        window.location.href = 'deleteImgById?id='+id+'&userid='+userid;
    }
</script>

</body>
</html>